var express = require('express');
var router = express.Router();
var storyController = require('../controllers/storycontroller')
//查看所有故事信息 列表
router.get('/', function(req, res, next){
   storyController.getALLStory(req,res)

});
//查看单个故事信息
router.get('/storynews', function(req, res, next) {     
  storyController.getStoryId(req,res)

    // res.send('respond with a resource');
});
router.get('/backstorys', function(req, res, next) {     
  storyController.getbackStoryId(req,res)

    // res.send('respond with a resource');
});



//上传故事信息
router.post('/insertstory', function(req, res, next) {     
    storyController.insertStory(req,res)
    // res.send('respond with a resource');
});
//回复故事信息
router.post('/insertbackstory', function(req, res, next) {     
  
    storyController.insertBackStory(req,res)
});
router.delete('/delBackStory', function(req, res, next) {     
  
    storyController.delBackStory(req,res)
});
router.delete('/delStory', function(req, res, next) {     
  
    storyController.delStory(req,res)
});
module.exports=router
